var filtering_running = 'No';
var wpforms_search_running = 'No';
jQuery(function(){ //DOM Ready
ufaqSetClickHandlers();
UFAQSetAutoCompleteClickHandlers();
UFAQSetRatingHandlers();
UFAQSetExpandCollapseHandlers();
UFAQSetPaginationHandlers();
UFAQWPFormsHandler();
});
function runEffect(display, post_id) {
var selectedEffect = reveal_effect;
// most effect types need no options passed by default
var options = {};
// some effects have required parameters
if ( selectedEffect === "size" ) {
options = { to: { width: 200, height: 60 } };
}
// run the effect
if (display == "show") {jQuery( "#ufaq-body-"+post_id ).show( selectedEffect, options, 500, handleStyles(display, post_id) );}
if (display == "hide") {jQuery( "#ufaq-body-"+post_id ).hide( selectedEffect, options, 500, handleStyles(display, post_id) );}
};
// callback function to bring a hidden box back
function handleStyles(display, post_id) {
if (display == "show") {setTimeout(function() {jQuery('#ufaq-body-'+post_id).removeClass("ewd-ufaq-hidden"); }, 500 );}
if (display == "hide") {setTimeout(function() {jQuery('#ufaq-body-'+post_id).addClass("ewd-ufaq-hidden");}, 500 );}
};
function ufaqSetClickHandlers() {
jQuery('.ufaq-faq-toggle').off('click').on('click', function(event) {
var post_id = jQuery(this).attr("data-postid");
jQuery(this).attr('aria-expanded', function (i, attr) {
return attr == 'true' ? 'false' : 'true'
});
event.preventDefault();
var selectedIDString = 'ufaq-body-'+post_id;
if (jQuery('#'+selectedIDString).hasClass("ewd-ufaq-hidden")) {
EWD_UFAQ_Reveal_FAQ(post_id, selectedIDString);
}
else {
EWD_UFAQ_Hide_FAQ(post_id);
}
});
jQuery('.ufaq-faq-category-title-toggle').off('click').on('click', function(event) {
var category_id = jQuery(this).attr("data-categoryid");
var closed = jQuery('#ufaq-faq-category-body-'+category_id).hasClass("ufaq-faq-category-body-hidden");
if (jQuery(this).hasClass('ufaq-faq-category-title-accordion')) {
jQuery('.ufaq-faq-category-inner').addClass("ufaq-faq-category-body-hidden");
}
if (closed) {
jQuery('#ufaq-faq-category-body-'+category_id).removeClass("ufaq-faq-category-body-hidden");
}
else {
jQuery('#ufaq-faq-category-body-'+category_id).addClass("ufaq-faq-category-body-hidden");
}
});
jQuery('.ufaq-back-to-top-link').off('click').on('click', function(event) {
event.preventDefault();
jQuery('html, body').animate({scrollTop: jQuery("#ufaq-faq-list").offset().top -80}, 100);
});
jQuery('.ufaq-faq-header-link').off('click').on('click', function(event) {
event.preventDefault();
var faqID = jQuery(this).data("postid");
if (jQuery('#ufaq-body-'+faqID).hasClass('ewd-ufaq-hidden')) {
var selectedIDString = 'ufaq-body-'+faqID;
EWD_UFAQ_Reveal_FAQ(faqID, selectedIDString);
}
jQuery('html, body').animate({scrollTop: jQuery("#ufaq-post-"+faqID).offset().top -20}, 100);
});
}
function UFAQSetAutoCompleteClickHandlers() {
jQuery('#ufaq-ajax-text-input').on('keyup', function() {
if (typeof autocompleteQuestion === 'undefined' || autocompleteQuestion === null) {autocompleteQuestion = "No";}
if (autocompleteQuestion == "Yes") {
jQuery('#ufaq-ajax-text-input').autocomplete({
source: questionTitles,
minLength: 3,
appendTo: "#ewd-ufaq-jquery-ajax-search",
select: function(event, ui) {
jQuery(this).val(ui.item.value);
Ufaq_Ajax_Reload();
}
});
jQuery('#ufaq-ajax-text-input').autocomplete( "enable" );
}
});
}
function EWD_UFAQ_Reveal_FAQ(post_id, selectedIDString) {
var data = 'post_id=' + post_id + '&action=ufaq_record_view';
jQuery.post(ajaxurl, data, function(response) {});
jQuery('#ewd-ufaq-post-symbol-'+post_id).html(jQuery('#ewd-ufaq-post-symbol-'+post_id).html().toUpperCase());
jQuery('#ufaq-excerpt-'+post_id).addClass("ewd-ufaq-hidden");
if (reveal_effect != "none") {runEffect("show", post_id); }
else {jQuery('#ufaq-body-'+post_id).removeClass("ewd-ufaq-hidden"); }
if (faq_accordion) {
jQuery('.ufaq-faq-div').each(function() {
if (jQuery(this).data("postid") != post_id) {
EWD_UFAQ_Hide_FAQ(jQuery(this).data("postid"));
} else{
jQuery(this).addClass("ewd-ufaq-post-active");
}
});
}
else {
jQuery('#ufaq-post-'+post_id).addClass("ewd-ufaq-post-active");
}
}
function EWD_UFAQ_Hide_FAQ(post_id) {
jQuery('#ufaq-excerpt-'+post_id).removeClass("ewd-ufaq-hidden");
if (reveal_effect != "none") {runEffect("hide", post_id);}
else {jQuery('#ufaq-body-'+post_id).addClass("ewd-ufaq-hidden");}
jQuery('#ufaq-post-'+post_id).removeClass("ewd-ufaq-post-active");
jQuery('#ewd-ufaq-post-symbol-'+post_id).html(jQuery('#ewd-ufaq-post-symbol-'+post_id).html().toLowerCase());
}
jQuery(document).ready(function() {
if (typeof(faq_scroll) == "undefined") {faq_scroll = false;}
if (faq_scroll) {
jQuery('.ufaq-faq-title').click(function(){
var faqID = jQuery(this).attr('id');
jQuery('html, body').animate({scrollTop: jQuery(this).offset().top -80}, 100);
});
}
jQuery("#ufaq-ajax-search-btn").click(function(){
Ufaq_Ajax_Reload();
});
jQuery('#ufaq-ajax-form').submit( function(event) {
event.preventDefault();
Ufaq_Ajax_Reload();
});
jQuery('#ufaq-ajax-text-input').keyup(function() {
Ufaq_Ajax_Reload();
});
if (jQuery('#ufaq-ajax-text-input').length) {
if (jQuery('#ufaq-ajax-text-input').val() != "") {Ufaq_Ajax_Reload();}
}
if (typeof(Display_FAQ_ID) != "undefined" && Display_FAQ_ID !== null) {
Display_FAQ_ID_Pos = Display_FAQ_ID.indexOf('-');
Display_FAQ_ID = Display_FAQ_ID.substring(0, Display_FAQ_ID_Pos);
var selectedIDString = jQuery('.ufaq-body-'+Display_FAQ_ID).attr('id');
Display_FAQ_ID = selectedIDString.substring(10);
EWD_UFAQ_Reveal_FAQ(Display_FAQ_ID, selectedIDString);
jQuery('html, body').delay(800).animate({scrollTop: jQuery("#"+selectedIDString).offset().top - 180}, 300);
}
});
var RequestCount = 0;
function Ufaq_Ajax_Reload(pagination, append_results) {
filtering_running = 'Yes';
var Question = jQuery('.ufaq-text-input').val();
var include_cat = jQuery('#ufaq-include-category').val();
var exclude_cat = jQuery('#ufaq-exclude-category').val();
var orderby = jQuery('#ufaq-orderby').val();
var order = jQuery('#ufaq-order').val();
var post_count = jQuery('#ufaq-post-count').val();
var current_url = jQuery('#ufaq-current-url').val();
var show_on_load = jQuery('#ufaq-show-on-load').val();
if (Question == undefined) {Question = '';}
if (pagination == 'Yes') {
var faqs_only = 'Yes';
var faq_page = jQuery('.ewd-ufaq-bottom').data('currentpage');
}
else {
jQuery('#ufaq-ajax-results').html('
' + ewd_ufaq_php_data.retrieving_results + '
');
var faqs_only = 'No';
var faq_page = 0;
}
RequestCount = RequestCount + 1;
if (show_on_load == 'No' && Question.length == 0) {jQuery('#ufaq-ajax-results').html(''); return;}
var data = 'Q=' + Question + '&include_category=' + include_cat + '&exclude_category=' + exclude_cat + '&orderby=' + orderby + '&order=' + order + '&post_count=' + post_count + '&request_count=' + RequestCount + '¤t_url=' + current_url + '&faqs_only=' + faqs_only + '&faq_page=' + faq_page + '&action=ufaq_search';
jQuery.post(ajaxurl, data, function(response) {
var parsed_response = jQuery.parseJSON(response);
if (parsed_response.request_count == RequestCount) {
if (append_results == 'Yes') {jQuery('.ewd-ufaq-faqs').append(parsed_response.message);}
else if (pagination == 'Yes') {jQuery('.ewd-ufaq-faqs').html(parsed_response.message)}
else {jQuery('#ufaq-ajax-results').html(parsed_response.message);}
jQuery('.ewd-ufaq-expand-all').removeClass('ewd-ufaq-hidden');
jQuery('.ewd-ufaq-collapse-all').addClass('ewd-ufaq-hidden');
ufaqSetClickHandlers();
UFAQSetRatingHandlers();
UFAQSetPaginationHandlers();
UFAQUpdatePaginationButtons();
UFAQSetExpandCollapseHandlers();
filtering_running = 'No';
}
});
}
function UFAQSetRatingHandlers() {
jQuery('.ewd-ufaq-rating-button').off('click');
jQuery('.ewd-ufaq-rating-button').on('click', function() {
var FAQ_ID = jQuery(this).data('ratingfaqid');
jQuery('*[data-ratingfaqid="' + FAQ_ID + '"]').off('click');
var Current_Count = jQuery(this).html();
Current_Count++;
jQuery(this).html(Current_Count);
if (jQuery(this).hasClass("ewd-ufaq-up-vote")) {Vote_Type = "Up";}
else {Vote_Type = "Down";}
var data = '&FAQ_ID=' + FAQ_ID + '&Vote_Type=' + Vote_Type + '&action=ufaq_update_rating';
jQuery.post(ajaxurl, data, function(response) {
});
});
}
function UFAQSetExpandCollapseHandlers() {
jQuery('.ewd-ufaq-expand-all').off('click').on('click', function() {
var accordion_setting = faq_accordion;
faq_accordion = false; // turn FAQ accordion off while expanding all
jQuery('.ufaq-faq-toggle').each(function() {
var post_id = jQuery(this).attr("data-postid");
jQuery(this).attr('aria-expanded', 'true');
var selectedIDString = 'ufaq-body-'+post_id;
EWD_UFAQ_Reveal_FAQ(post_id, selectedIDString);
});
faq_accordion = accordion_setting; //reset FAQ accordion setting
jQuery('.ufaq-faq-category-inner').removeClass('ufaq-faq-category-body-hidden');
jQuery('.ewd-ufaq-collapse-all').removeClass('ewd-ufaq-hidden');
jQuery('.ewd-ufaq-expand-all').addClass('ewd-ufaq-hidden');
});
jQuery('.ewd-ufaq-collapse-all').off('click').on('click', function() {
jQuery('.ufaq-faq-toggle').each(function() {
var post_id = jQuery(this).attr("data-postid");
jQuery(this).attr('aria-expanded', 'false');
EWD_UFAQ_Hide_FAQ(post_id);
});
if (jQuery('.ufaq-faq-category-title-toggle').length > 0) {jQuery('.ufaq-faq-category-inner').addClass('ufaq-faq-category-body-hidden');}
jQuery('.ewd-ufaq-expand-all').removeClass('ewd-ufaq-hidden');
jQuery('.ewd-ufaq-collapse-all').addClass('ewd-ufaq-hidden');
});
}
function UFAQSetPaginationHandlers() {
jQuery('.ewd-ufaq-previous-faqs').on('click', function() {
var current_page = jQuery('.ewd-ufaq-bottom').data('currentpage');
jQuery('.ewd-ufaq-bottom').data('currentpage', Math.max(current_page - 1, 0));
jQuery('.ewd-ufaq-max-faqs-not-reached').remove();
Ufaq_Ajax_Reload("Yes", "No");
});
jQuery('.ewd-ufaq-next-faqs').on('click', function() {
var current_page = jQuery('.ewd-ufaq-bottom').data('currentpage');
jQuery('.ewd-ufaq-bottom').data('currentpage', current_page + 1);
jQuery('.ewd-ufaq-max-faqs-not-reached').remove();
Ufaq_Ajax_Reload("Yes", "No");
});
jQuery('.ewd-ufaq-load-more').on('click', function() {
var current_page = jQuery('.ewd-ufaq-bottom').data('currentpage');
jQuery('.ewd-ufaq-bottom').data('currentpage', current_page + 1);
jQuery('.ewd-ufaq-max-faqs-not-reached').remove();
Ufaq_Ajax_Reload("Yes", "Yes");
});
if (jQuery('.ewd-ufaq-page-type-Infinite_Scroll').length) {
jQuery(window).scroll(function(){
var InfinitePos = jQuery('.ewd-ufaq-page-type-Infinite_Scroll').position();
if (InfinitePos != undefined && jQuery('.ewd-ufaq-max-faqs-not-reached').length) {
if ((jQuery(window).height() + jQuery(window).scrollTop() > InfinitePos.top) && filtering_running == "No"){
jQuery('.ewd-ufaq-bottom').data('currentpage', jQuery('.ewd-ufaq-bottom').data('currentpage') + 1)
Ufaq_Ajax_Reload("Yes", "Yes");
}
}
});
}
}
function UFAQUpdatePaginationButtons() {
jQuery('.ewd-ufaq-bottom').first().appendTo('.ufaq-faq-list');
if (jQuery('.ewd-ufaq-max-faqs-not-reached').length) {
jQuery('.ewd-ufaq-load-more, .ewd-ufaq-next-faqs').removeClass('ewd-ufaq-hidden');
}
else {jQuery('.ewd-ufaq-load-more, .ewd-ufaq-next-faqs').addClass('ewd-ufaq-hidden');}
if (jQuery('.ewd-ufaq-bottom').data('currentpage') == 0) {
jQuery('.ewd-ufaq-previous-faqs').addClass('ewd-ufaq-hidden');
}
else {jQuery('.ewd-ufaq-previous-faqs').removeClass('ewd-ufaq-hidden');}
}
function UFAQWPFormsHandler() {
if ( typeof wpforms_integration === 'undefined' || wpforms_integration === null ) { return; }
if ( wpforms_integration.ufaq_enabled == 2 ) { return; }
var target_field = wpforms_integration.ufaq_selected_field;
jQuery( '#wpforms-' + wpforms_integration.form_id + '-field_' + wpforms_integration.ufaq_selected_field ).on( 'keyup', function() {
var search_string = jQuery( this ).val();
if ( search_string.length > 12 && wpforms_search_running == 'No' ) {
wpforms_search_running = 'Yes';
UFAQWPFormsSearch( search_string );
}
else if ( wpforms_search_running == 'No' ) {
jQuery('#ufaq-ajax-results').html( '' );
jQuery( '.ewd-ufaq-wpforms-label' ).addClass( 'ewd-ufaq-hidden' );
}
});
}
var WPForms_RequestCount = 0;
function UFAQWPFormsSearch( search_string ) {
var current_url = jQuery('#ufaq-current-url').val();
WPForms_RequestCount = WPForms_RequestCount + 1;
data = 'search_string=' + search_string + '¤t_url=' + current_url + '&request_count=' + WPForms_RequestCount + '&action=ufaq_wpforms_search';
jQuery.post(ajaxurl, data, function(response) {
var parsed_response = jQuery.parseJSON(response);
if (parsed_response.request_count == WPForms_RequestCount) {
if ( parsed_response.message != false ){
jQuery('#ufaq-ajax-results').html(parsed_response.message);
jQuery( '.ewd-ufaq-wpforms-label' ).removeClass( 'ewd-ufaq-hidden' );
jQuery('.ewd-ufaq-expand-all').removeClass('ewd-ufaq-hidden');
jQuery('.ewd-ufaq-collapse-all').addClass('ewd-ufaq-hidden');
ufaqSetClickHandlers();
UFAQSetRatingHandlers();
UFAQSetExpandCollapseHandlers();
}
else {
jQuery('#ufaq-ajax-results').html( '' );
jQuery( '.ewd-ufaq-wpforms-label' ).addClass( 'ewd-ufaq-hidden' );
}
wpforms_search_running = 'No';
}
});
}
/*jQuery(document).ready(function() {
jQuery('a[href*=#]:not([href=#])').click(function() {
var post_id = jQuery(this).attr("data-postid");
var selectedIDString = 'ufaq-body-'+post_id;
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = jQuery(this.hash);
target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']');
if (target.length) {
jQuery('html,body').on("scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove", function(){
jQuery('html,body').stop();
});
if (jQuery('#'+selectedIDString).hasClass("ewd-ufaq-hidden")) {
EWD_UFAQ_Reveal_FAQ(post_id, selectedIDString);
}
jQuery('html,body').animate({
scrollTop: target.offset().top
}, 1000);
//return false;
}
}
});
});*/
;
/*!
* jQuery UI Core 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/ui-core/
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(a){var e,t,n,i;function r(e,t){var n,i,r,o=e.nodeName.toLowerCase();return"area"===o?(i=(n=e.parentNode).name,!(!e.href||!i||"map"!==n.nodeName.toLowerCase())&&(!!(r=a("img[usemap='#"+i+"']")[0])&&s(r))):(/^(input|select|textarea|button|object)$/.test(o)?!e.disabled:"a"===o&&e.href||t)&&s(e)}function s(e){return a.expr.filters.visible(e)&&!a(e).parents().addBack().filter(function(){return"hidden"===a.css(this,"visibility")}).length}a.ui=a.ui||{},a.extend(a.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),a.fn.extend({scrollParent:function(e){var t=this.css("position"),n="absolute"===t,i=e?/(auto|scroll|hidden)/:/(auto|scroll)/,r=this.parents().filter(function(){var e=a(this);return(!n||"static"!==e.css("position"))&&i.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==t&&r.length?r:a(this[0].ownerDocument||document)},uniqueId:(e=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&a(this).removeAttr("id")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(t){return function(e){return!!a.data(e,t)}}):function(e,t,n){return!!a.data(e,n[3])},focusable:function(e){return r(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(e){var t=a.attr(e,"tabindex"),n=isNaN(t);return(n||0<=t)&&r(e,!n)}}),a("").outerWidth(1).jquery||a.each(["Width","Height"],function(e,n){var r="Width"===n?["Left","Right"]:["Top","Bottom"],i=n.toLowerCase(),o={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function s(e,t,n,i){return a.each(r,function(){t-=parseFloat(a.css(e,"padding"+this))||0,n&&(t-=parseFloat(a.css(e,"border"+this+"Width"))||0),i&&(t-=parseFloat(a.css(e,"margin"+this))||0)}),t}a.fn["inner"+n]=function(e){return void 0===e?o["inner"+n].call(this):this.each(function(){a(this).css(i,s(this,e)+"px")})},a.fn["outer"+n]=function(e,t){return"number"!=typeof e?o["outer"+n].call(this,e):this.each(function(){a(this).css(i,s(this,e,!0,t)+"px")})}}),a.fn.addBack||(a.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),a("").data("a-b","a").removeData("a-b").data("a-b")&&(a.fn.removeData=(t=a.fn.removeData,function(e){return arguments.length?t.call(this,a.camelCase(e)):t.call(this)})),a.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),a.fn.extend({focus:(i=a.fn.focus,function(t,n){return"number"==typeof t?this.each(function(){var e=this;setTimeout(function(){a(e).focus(),n&&n.call(e)},t)}):i.apply(this,arguments)}),disableSelection:(n="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.bind(n+".ui-disableSelection",function(e){e.preventDefault()})}),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(e){if(void 0!==e)return this.css("zIndex",e);if(this.length)for(var t,n,i=a(this[0]);i.length&&i[0]!==document;){if(("absolute"===(t=i.css("position"))||"relative"===t||"fixed"===t)&&(n=parseInt(i.css("zIndex"),10),!isNaN(n)&&0!==n))return n;i=i.parent()}return 0}}),a.ui.plugin={add:function(e,t,n){var i,r=a.ui[e].prototype;for(i in n)r.plugins[i]=r.plugins[i]||[],r.plugins[i].push([t,n[i]])},call:function(e,t,n,i){var r,o=e.plugins[t];if(o&&(i||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(r=0;r")[0],b=u.each,e.style.cssText="background-color:rgba(1,1,1,.5)",i.rgba=-1a.mod/2?r+=a.mod:r-o>a.mod/2&&(r-=a.mod)),c[n]=_((o-r)*i+r,e)))}),this[e](c)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),n=e.pop(),r=p(t)._rgba;return p(u.map(e,function(t,e){return(1-n)*r[e]+n*t}))},toRgbaString:function(){var t="rgba(",e=u.map(this._rgba,function(t,e){return null==t?2").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:n.width(),height:n.height()},o=document.activeElement;try{o.id}catch(t){o=document.body}return n.wrap(t),n[0]!==o&&!s.contains(n[0],o)||s(o).focus(),t=n.parent(),"static"===n.css("position")?(t.css({position:"relative"}),n.css({position:"relative"})):(s.extend(r,{position:n.css("position"),zIndex:n.css("z-index")}),s.each(["top","left","bottom","right"],function(t,e){r[e]=n.css(e),isNaN(parseInt(r[e],10))&&(r[e]="auto")}),n.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),n.css(e),t.css(r).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!s.contains(t[0],e)||s(e).focus()),t},setTransition:function(r,t,o,a){return a=a||{},s.each(t,function(t,e){var n=r.cssUnit(e);0",options:{disabled:!1,create:null},_createWidget:function(t,e){e=h(e||this.defaultElement||this)[0],this.element=h(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=h(),this.hoverable=h(),this.focusable=h(),e!==this&&(h.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=h(e.style?e.ownerDocument:e.document||e),this.window=h(this.document[0].defaultView||this.document[0].parentWindow)),this.options=h.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:h.noop,_getCreateEventData:h.noop,_create:h.noop,_init:h.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(h.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:h.noop,widget:function(){return this.element},option:function(t,e){var i,n,s,o=t;if(0===arguments.length)return h.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(n=o[t]=h.widget.extend({},this.options[t]),s=0;s"),o=e.children()[0];return I("body").append(e),t=o.offsetWidth,e.css("overflow","scroll"),t===(i=o.offsetWidth)&&(i=e[0].clientWidth),e.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),e=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),o="scroll"===i||"auto"===i&&t.widthx(T(o),T(n))?l.important="horizontal":l.important="vertical",c.using.call(this,t,l)}),f.offset(I.extend(r,{using:t}))})},I.ui.position={fit:{left:function(t,i){var e,o=i.within,n=o.isWindow?o.scrollLeft:o.offset.left,l=o.width,f=t.left-i.collisionPosition.marginLeft,s=n-f,h=f+i.collisionWidth-l-n;i.collisionWidth>l?0l?0",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(e){var t=o(e.target);!this.mouseHandled&&t.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),t.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&o(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var t=o(e.currentTarget);t.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(e,t)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(e){this._delay(function(){o.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=o(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){var t,i,s,n,a=!0;switch(e.keyCode){case o.ui.keyCode.PAGE_UP:this.previousPage(e);break;case o.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case o.ui.keyCode.HOME:this._move("first","first",e);break;case o.ui.keyCode.END:this._move("last","last",e);break;case o.ui.keyCode.UP:this.previous(e);break;case o.ui.keyCode.DOWN:this.next(e);break;case o.ui.keyCode.LEFT:this.collapse(e);break;case o.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case o.ui.keyCode.ENTER:case o.ui.keyCode.SPACE:this._activate(e);break;case o.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,i=this.previousFilter||"",s=String.fromCharCode(e.keyCode),n=!1,clearTimeout(this.filterTimer),s===i?n=!0:s=i+s,t=this._filterMenuItems(s),(t=n&&-1!==t.index(this.active.next())?this.active.nextAll(".ui-menu-item"):t).length||(s=String.fromCharCode(e.keyCode),t=this._filterMenuItems(s)),t.length?(this.focus(e,t),this.previousFilter=s,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var e,t=this,s=this.options.icons.submenu,i=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),i.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=o(this),t=e.parent(),i=o("").addClass("ui-menu-icon ui-icon "+s).data("ui-menu-submenu-carat",!0);t.attr("aria-haspopup","true").prepend(i),e.attr("aria-labelledby",t.attr("id"))}),(e=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var e=o(this);t._isDivider(e)&&e.addClass("ui-widget-content ui-menu-divider")}),e.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),e.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!o.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=t.children(".ui-menu")).length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(e){var t,i,s,n,a,u;this._hasScroll()&&(t=parseFloat(o.css(this.activeMenu[0],"borderTopWidth"))||0,i=parseFloat(o.css(this.activeMenu[0],"paddingTop"))||0,s=e.offset().top-this.activeMenu.offset().top-t-i,n=this.activeMenu.scrollTop(),a=this.activeMenu.height(),u=e.outerHeight(),s<0?this.activeMenu.scrollTop(n+s):a